package aiguigu03.field_method.method;

/**
 * ClassName: Employee
 * Package: aiguigu03.field_method
 * Description:
 *
 * @Author ZY
 * @Create 2024/9/22 20:54
 * @Version 1.0
 */
public class Employee {
    //属性
    int id;//编号
    String name;//姓名
    int age;//年龄
    double salary;//薪资

    //定义一个方法，用于显示员工的属性信息
    public void show() {
        System.out.println("id = " + id + ",name = " + name +
                ",age = " + age + ",salary = " + salary);
    }

    public String show1() {
        // 返回一个字符串，包含对象的id、name、age和salary属性的值
        return "id = " + id + ",name = " + name +
                ",age = " + age + ",salary = " + salary;
    }


}
